import { Reactive } from "vue";

export class MessageBox {
    static messagebox_container:Reactive<any>|null=null

    static alert_fn:((title: string, msg: string)=>void)|null=null
    static confirm_fn:((title:string, message:string, fn: (() => void)|null, fn_cancle: (() => void)|null)=>void)|null=null

    static alert(message:string|undefined="",title="友情提示"){
        // MessageBox.messagebox_container?.alert(title,message)
        if(!message) message=""
        MessageBox.alert_fn?.(title,message)
    }
    static confirm(title="",message="",fn:(()=>void)|null=null,fn_cancle:(()=>void)|null=null) {
        MessageBox.confirm_fn?.(title,message,fn,fn_cancle)
    }

}